#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    ui->comboBox->addItem("巨⽆霸");
    ui->comboBox->addItem("⻨辣鸡腿堡");
    ui->comboBox_2->addItem("薯条");
    ui->comboBox_2->addItem("麦辣鸡翅");
    ui->comboBox_3->addItem("可乐");
    ui->comboBox_3->addItem("橙汁");

    ui->spinBox->setValue(1);
    ui->spinBox->setRange(1,5);
    ui->spinBox_2->setValue(1);
    ui->spinBox_2->setValue(1);
    ui->spinBox_2->setRange(1,5);
    ui->spinBox_3->setValue(1);
    ui->spinBox_3->setRange(1,5);

}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_clicked()
{
    qDebug()<<"成功下单";
}

void Widget::on_spinBox_3_valueChanged(int arg1)
{
    if(arg1>5)
        ui->label_4->setText("已经超过限购量");
//    else
//        ui->spinBox_3->setValue(arg1+1);
}

void Widget::on_spinBox_2_valueChanged(int arg1)
{
    if(arg1>5)
        ui->label_5->setText("已经超过限购量");
//    else
//        ui->spinBox_2->setValue(arg1+1);

}

void Widget::on_spinBox_valueChanged(int arg1)
{
    if(arg1>5)
        ui->label_6->setText("已经超过限购量");
//    else
//        ui->spinBox->setValue(arg1+1);
}
